package pers.ree.demo.base;

import org.junit.Test;

public class IntegerDemo {

    private static Integer i1 = new Integer(1);
    private static Integer i2 = new Integer(1);

    private final static Long l1 = 1L;

    public static void main(String[] args) {
//        System.out.println(Math.pow(2,30) == 1<<30);
//
//        System.out.println(1<<30 < Integer.MAX_VALUE);
//
//        System.out.println(Integer.highestOneBit(16));

        System.out.println(System.identityHashCode(i1));
        System.out.println(System.identityHashCode(i2));
    }

    @Test
    public void memory() {
        Integer i3 = new Integer(1);
        Integer i4 = new Integer(1);

        System.out.println(System.identityHashCode(i3));
        System.out.println(System.identityHashCode(i4));
    }

    public void classByteCodeDemo() {
        Integer i1 = 127;
        Integer i2 = 127;

        System.out.println(i1.equals(i2));

        Integer i3 = 128;

        System.out.println(i3);

        Integer i4 = 128;

        String[][][] iii = new String[3][3][3];
    }
}
